After installing everything properly, it is very simple to use the Nonlinear Schrodinger Suite (NLSS.jl). First, we start by "using" the package.
You can ignore the lines below using NLSS.jl, they are to make the plots larger.
using NLSS
using Plots
upscale = 2 #8x upscaling in resolution
fntsm = Plots.font("sans-serif", pointsize=round(10.0*upscale))
fntlg = Plots.font("sans-serif", pointsize=round(14.0*upscale))
default(titlefont=fntlg, guidefont=fntlg, tickfont=fntsm, legendfont=fntsm)
default(size=(800*upscale,600*upscale)) #Plot canvas size
default(fmt=:png)
┌ Info: Precompiling NLSS [b3fbeaf7-5746-403c-a6b7-06939dc82746] └ @ Base loading.jl:1278
To run a simple simulation of the NLSE, we start by defining some parameters, we can choose either $a$, $T$, $\Omega$ or $\lambda$ and pass it to the params function which will convert it to the 3 important ones $\lambda, T$ and $\Omega$.
λ, T, Ω = params(λ = 0.98im) # Supply the eigenvalue
λ, T, Ω = params(T = 15.787097084991364) # Supply the period
λ, T, Ω = params(Ω = 0.3979949748426484) # Supply the Frequency
λ, T, Ω = params(a = 0.4802) # Supply the Frequency
┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92 ┌ Info: Passed T = 15.787097084991364, computed λ = 0.0 + 0.98im and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:102 ┌ Info: Passed Ω=0.3979949748426484, computed λ = 0.0 + 0.98im and T = 15.787097084991364 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:97 ┌ Info: Passed a = 0.4802, computed λ = 0.0 + 0.98im, T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:87
(0.0 + 0.98im, 15.787097084991364, 0.3979949748426484)
Then we create a simulation box. The first 2 parameters are mandatory, $x_r$ which is the $x$ range of the box and $T$ which is the tepmoral size of the box. $x_r$ is supplied as a pair: e.g. x_r = 0=>10 and the box will run from x = 0 to x = 10. T is supplied as a float and the box will range across the interval $[-T/2, T/2)$.
The remaining parameters are optional and have defaults. For example, you can supply dx (the "time" step in the longitudinal direction, or you can supply $N_x$ directly), $N_t$ (the number of nodes in the transverse (t) direction), n_periods (a multiple for the number of periods), etc.
xᵣ = 0=>20
box = Box(xᵣ, T, dx=1e-3, Nₜ = 512, n_periods = 1);
Longitudinal range is [0, 20], transverse range is [-7.893548542495682, 7.893548542495682)
┌ Info: Initializing simulation box with 1 period(s) and dx = 0.001, Nₜ = 512. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:13 ┌ Info: Done computing t, x, ω └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:35
Then we create the initial wave function. For this example, we will use a simple cosine wave function that we usually use, with coefficients supplied in the array coeff. You can supply as many as you want and A_0 will be automatically created to ensure normalization.
coeff = [1e-4, 1e-5]
ψ₀, A₀ = ψ₀_periodic(coeff, box, Ω);
==========================================
┌ Info: Initializing periodic ψ₀ └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:150 ┌ Info: Computing A₀ to preserve normalization. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:157 ┌ Info: Computed A₀ = 0.9999999898999999 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:159 ┌ Info: ψ₀ = 0.9999999898999999 + 2 × 0.0001 × cos(1 × 0.3979949748426484 t)2 × 1.0e-5 × cos(2 × 0.3979949748426484 t) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:179
Now we are finally ready to create a simulation Sim object. We supply it with the eigenvalue $\lambda$, the box object created above, as well as the initial condition $\psi_0$. We also need to supply the algorithm as the fourth argument. The available integrators for the NLS are listed below. Note that each algorithm has 2 variants, A & B. A evaluates the nonlinear term first, and B evaluates the kinetic energy term first.
These are the usual symplectic integrators we have been using before. Reference: XXX
These algorithms are symplectic but require a very large number of force evaluations. However, they use very small time steps. Reference: XXX
These algorithms are the multi product Nystrom integrators we have used in the past. Reference: Prof. Chin's paper.
These algorithms are optimized to minimize the number of force evaluations and use very specific coefficients. The 8th order uses only 15 force evaluations for example. Reference: XXX
sim = Sim(λ, box, ψ₀, T2A!); # Don't forget the exclamation point
┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92
Now we can solve the simulation object
solve!(sim)
Solving cubic NLSE with the following options: Box Properties: ------------------------------------------ dx = 0.001 (Nₓ = 20001) Nₜ = 0.001 (dt = 0.03083417399412376) Parameters: ------------------------------------------ λ = 0.0 + 0.98im Ω = 0.3979949748426484 T = 15.787097084991364 ------------------------------------------ Equation: Cubic NLSE Algorithm: T2A! ------------------------------------------
┌ Info: nothing └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:12 ┌ Info: Generating FFT plans └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:171 ┌ Info: Starting evolution └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:27 ┌ Info: Computing Spectrum └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:52 ┌ Info: Computation Done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:37
And compute the integrals of motion (Energy, Momentum and Charge [particle number or norm])
compute_IoM!(sim)
┌ Info: Computing integrals of motions └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:29 ┌ Info: Integrals of motion computed. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:50
Let's plot the results. The flag power in plot_ψ controls whether we plot $|\psi|$ or $|\psi|^2$.
p = plot_ψ(sim, mode="density", power=2) # plots |ψ|^2
display(p)
p = plot_ψ̃(sim, mode = "density") # plots spectrum in density mode
display(p)
p = plot_IoM(sim) # Plots total energy, pot energy, kinetic energy, energy error, norm error, momentum error
display(p)
┌ Info: Plotting |ψ|^2 in density mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:56 ┌ Info: Plotting ψ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:165
┌ Info: Plotting log(|ψ̃|) in density mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:182 ┌ Info: Plotting ψ̃ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:220 ┌ Info: Plotting IoM with a resolution of 500 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:11 ┌ Info: Plotting IoM Done └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:40
Let's create a simulation with 3 periods without pruning
λ, T, Ω = NLSS.params(λ = 0.98im)
xᵣ = 0=>100
box = Box(xᵣ, T, dx=1e-3, Nₜ = 512, n_periods = 3)
coeff = [1e-4]
ψ₀, A₀ = ψ₀_periodic(coeff, box, Ω)
sim = Sim(λ, box, ψ₀, T2A!, αₚ = 0.0)
solve!(sim)
p = plot_ψ(sim, mode="density", power=1) # plots ψ
display(p)
p = plot_ψ̃(sim, mode = "lines") # plots spectrum
display(p)
Longitudinal range is [0, 100], transverse range is [-23.680645627487046, 23.680645627487046) ========================================== Solving cubic NLSE with the following options: Box Properties: ------------------------------------------ dx = 0.001 (Nₓ = 100001) Nₜ = 0.001 (dt = 0.09250252198237127) Parameters: ------------------------------------------ λ = 0.0 + 0.98im Ω = 0.3979949748426484 T = 15.787097084991364 ------------------------------------------ Equation: Cubic NLSE Algorithm: T2A! ------------------------------------------
┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92 ┌ Info: Initializing simulation box with 3 period(s) and dx = 0.001, Nₜ = 512. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:13 ┌ Info: Done computing t, x, ω └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:35 ┌ Info: Initializing periodic ψ₀ └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:150 ┌ Info: Computing A₀ to preserve normalization. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:157 ┌ Info: Computed A₀ = 0.99999999 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:159 ┌ Info: ψ₀ = 0.99999999 + 2 × 0.0001 × cos(1 × 0.3979949748426484 t) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:179 ┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92 ┌ Info: nothing └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:12 ┌ Info: Generating FFT plans └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:171 ┌ Info: Starting evolution └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:27 ┌ Info: Computing Spectrum └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:52 ┌ Info: Computation Done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:37
┌ Info: Plotting |ψ|^1 in density mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:56 ┌ Info: Plotting ψ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:165 ┌ Info: Plotting log(|ψ̃|) in lines mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:182 ┌ Info: Plotting ψ̃ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:220
And now with pruning
sim = Sim(λ, box, ψ₀, T2A!, αₚ = 5.0)
solve!(sim)
p = plot_ψ(sim, mode="density", power=1) # plots ψ
display(p)
p = plot_ψ̃(sim, mode = "lines") # plots spectrum
display(p)
Solving cubic NLSE with the following options: Box Properties: ------------------------------------------ dx = 0.001 (Nₓ = 100001) Nₜ = 0.001 (dt = 0.09250252198237127) Parameters: ------------------------------------------ λ = 0.0 + 0.98im Ω = 0.3979949748426484 T = 15.787097084991364 ------------------------------------------ Equation: Cubic NLSE Algorithm: T2A! ------------------------------------------
┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92 ┌ Info: nothing └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:12 ┌ Info: Generating FFT plans └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:171 ┌ Info: Starting evolution └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:27 ┌ Info: Computing Spectrum └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:52 ┌ Info: Computation Done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:37
┌ Info: Plotting |ψ|^1 in density mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:56 ┌ Info: Plotting ψ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:165
┌ Info: Plotting log(|ψ̃|) in lines mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:182 ┌ Info: Plotting ψ̃ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:220
To simulate the Hirota equation, you only have to add the parameter α when creating the simulation. There are currently two options for the algorithm, T2A_H, T1A_H!
λ, T, Ω = NLSS.params(λ = 0.9im)
xᵣ = 0=>40
box = Box(xᵣ, T, dx=1e-3, Nₜ = 512, n_periods = 3)
coeff = [1e-4]
ψ₀, A₀ = ψ₀_periodic(coeff, box, Ω)
sim = Sim(λ, box, ψ₀, T2A_H!, α = 0.1)
solve!(sim)
p = plot_ψ(sim, mode="density", power=1) # plots ψ
display(p)
p = plot_ψ̃(sim, mode = "lines") # plots spectrum
display(p)
Longitudinal range is [0, 40], transverse range is [-10.81096176218502, 10.81096176218502) ==========================================
┌ Info: Passed λ=0.0 + 0.9im, computed T = 7.2073078414566805 and Ω = 0.8717797887081346 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92 ┌ Info: Initializing simulation box with 3 period(s) and dx = 0.001, Nₜ = 512. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:13 ┌ Info: Done computing t, x, ω └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:35 ┌ Info: Initializing periodic ψ₀ └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:150 ┌ Info: Computing A₀ to preserve normalization. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:157 ┌ Info: Computed A₀ = 0.99999999 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:159 ┌ Info: ψ₀ = 0.99999999 + 2 × 0.0001 × cos(1 × 0.8717797887081346 t) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:179 ┌ Info: Passed λ=0.0 + 0.9im, computed T = 7.2073078414566805 and Ω = 0.8717797887081346 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92
Solving cubic NLSE with the following options: Box Properties: ------------------------------------------ dx = 0.001 (Nₓ = 40001) Nₜ = 0.001 (dt = 0.042230319383535234) Parameters: ------------------------------------------ λ = 0.0 + 0.9im Ω = 0.8717797887081346 T = 7.2073078414566805 ------------------------------------------ Equation: Hirota Equation with α = 0.1 Algorithm: T2A_H! ------------------------------------------
┌ Info: nothing └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:12 ┌ Info: Generating FFT plans └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:171 ┌ Info: Starting evolution └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:27 ┌ Info: Computing Spectrum └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:52 ┌ Info: Computation Done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:37
┌ Info: Plotting |ψ|^1 in density mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:56 ┌ Info: Plotting ψ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:165
┌ Info: Plotting log(|ψ̃|) in lines mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:182 ┌ Info: Plotting ψ̃ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:220
We can also use initial conditions from DT as we often need to do. We can use the
λ, T, Ω = NLSS.params(λ = 0.98im)
xᵣ = 0=>20
box = Box(xᵣ, T, dx=1e-3, Nₜ = 512, n_periods = 1)
λ_DT = λ_maximal(λ, 4) # Generates maximal intensity family with \lambda and order 4
xₛ = [0.0, 0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0, 0.0]
ψ₀ = NLSS.ψ₀_DT(λ_DT, tₛ, xₛ, -10, box) # -10 is where we extract the initial condition from DT
sim = Sim(λ, box, ψ₀, T4A_TJ!, αₚ = 0.0)
solve!(sim)
p = plot_ψ(sim, mode="density", power=1)
display(p)
p = plot_ψ̃(sim, mode = "lines")
display(p)
Longitudinal range is [0, 20], transverse range is [-7.893548542495682, 7.893548542495682) Longitudinal range is [-10, -9.99999], transverse range is [-7.893548542495682, 7.893548542495682)
┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92 ┌ Info: Initializing simulation box with 1 period(s) and dx = 0.001, Nₜ = 512. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:13 ┌ Info: Done computing t, x, ω └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:35 ┌ Info: Initializing simulation box with 1 period(s) and dx = 0.0, Nₜ = 512. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:13 ┌ Info: Done computing t, x, ω └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:35 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (4,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (3,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,3) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (3,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,3) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,4) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92
Solving cubic NLSE with the following options: Box Properties: ------------------------------------------ dx = 0.001 (Nₓ = 20001) Nₜ = 0.001 (dt = 0.03083417399412376) Parameters: ------------------------------------------ λ = 0.0 + 0.98im Ω = 0.3979949748426484 T = 15.787097084991364 ------------------------------------------ Equation: Cubic NLSE Algorithm: T4A_TJ! ------------------------------------------
┌ Info: nothing └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:12 ┌ Info: Generating FFT plans └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:171 ┌ Info: Starting evolution └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:27 ┌ Info: Computing Spectrum └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:52 ┌ Info: Computation Done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Simulation.jl:37
┌ Info: Plotting |ψ|^1 in density mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:56 ┌ Info: Plotting ψ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:165
┌ Info: Plotting log(|ψ̃|) in lines mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:182 ┌ Info: Plotting ψ̃ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:220
This is simple to do and similar to simulations. All 4 seeds are supported by passing the 4th argument "exp" "0" "cn" "dn".
λ, T, Ω = params(λ = 0.98im)
xᵣ = -20=>20
box = Box(xᵣ, T, Nₓ=1000, Nₜ = 1024, n_periods = 1)
λ = λ_maximal(λ,4)
xₛ = [0.0, 0.0, 0.0, 0.0]
tₛ = [0.0, 0.0, 0.0, 0.0]
calc = Calc(λ, tₛ, xₛ, "exp", box)
solve!(calc)
p = plot_ψ(calc, mode="surface", power=1)
display(p)
p = plot_ψ̃(calc, mode = "lines")
display(p)
Longitudinal range is [-20, 20], transverse range is [-7.893548542495682, 7.893548542495682)
┌ Info: Passed λ=0.0 + 0.98im, computed T = 15.787097084991364 and Ω = 0.3979949748426484 └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Utilities.jl:92 ┌ Info: Initializing simulation box with 1 period(s) and dx = 0.0, Nₜ = 1024. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:13 ┌ Info: Done computing t, x, ω └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Types.jl:35 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (4,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (3,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,3) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (3,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,3) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,4) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Plotting |ψ|^1 in surface mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:56 ┌ Info: Plotting ψ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:165
┌ Info: Plotting log(|ψ̃|) in lines mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:182 ┌ Info: Plotting ψ̃ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:220
calc = Calc(λ, tₛ, xₛ, "0", box)
solve!(calc)
p = plot_ψ(calc, mode="contourf", power=1)
display(p)
p = plot_ψ̃(calc, mode = "lines")
display(p)
┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (4,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (3,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,3) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (3,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,2) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (2,3) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,1) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Calculating Lax pair generating functions rₙₚ(x,t) and sₙₚ(x,t) for (n,p) = (1,4) └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Darboux.jl:20 ┌ Info: Plotting |ψ|^1 in contourf mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:56
┌ Info: Plotting ψ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:165 ┌ Info: Plotting log(|ψ̃|) in lines mode with ~500 longitudinal and ~512 transverse points. └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:182
┌ Info: Plotting ψ̃ done! └ @ NLSS /Users/ashour/.julia/dev/NLSS/src/Plotter.jl:220